package com.zhz.common.tool.mybatisplus.base.core.contract;

import lombok.*;
import lombok.experimental.Accessors;

import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ToString
public class PageParam<Q> {
    protected long page = 1L;
    protected long limit = 10L;
    protected Q param;
    protected List<SortParam> sorts;

    public PageParam(long page, long limit) {
        if (page > 1L) {
            this.page = page;
        }

        if (limit > 0L) {
            this.limit = limit;
        }

    }
    protected boolean canEqual(Object other) {
        return other instanceof PageParam;
    }

}
